package com.heima.behavior.controller.v1;

import com.heima.behavior.service.UserBehaviorService;
import com.heima.model.article.dtos.*;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rookie001
 * @creat 2023-06-20-21:03
 */
@RestController
@Slf4j
@RequestMapping("/api/v1")
public class UserBehaviorController {
    @Autowired
    private UserBehaviorService userBehaviorService;
    //点赞
    @PostMapping("/likes_behavior")
    public ResponseResult getUserBehavior(@RequestBody LikesBehaviorDto dto){
        return userBehaviorService.getUserBehavior(dto);
    }
    //浏览次数
    @PostMapping("read_behavior")
    public ResponseResult readUserBehavior(@RequestBody ReadTimeDto dto){
        return userBehaviorService.readUserBehavior(dto);
    }
    //不喜欢
    @PostMapping("un_likes_behavior")
    public ResponseResult unLikesBehavior(@RequestBody UnLikesBehaviorDto dto){
        return userBehaviorService.unLikesBehavior(dto);
    }

}
